package com.wolfking.demo.nio;

import java.nio.CharBuffer;

public class CharBufferDemo {
    public static void main(String[] args) {
        CharBuffer charBuffer = CharBuffer.allocate(1024);

        charBuffer.put("wolfking dfdf");
        charBuffer.flip();
        int limit = charBuffer.limit();
        for (int i = 0; i < limit; i++) {
            System.out.printf(charBuffer.get() + "");
        }
    }
}
